import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatCloudController } from '../../../controllers';
const uctoowechatCloudRouter = new Router();
const wechatCloudController = new uctooWechatCloudController();

uctoowechatCloudRouter.post('/add', requireUser, wechatCloudController.add);
uctoowechatCloudRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechat_cloud'), wechatCloudController.edit);
uctoowechatCloudRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechat_cloud'), wechatCloudController.delete);

//For getting wechatCloud with permission control
uctoowechatCloudRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechat_cloud'), wechatCloudController.getSingle);
uctoowechatCloudRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechat_cloud'), wechatCloudController.getMany);
uctoowechatCloudRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechat_cloud'), wechatCloudController.getMany);

//#endregion AutoCreateCode
export default uctoowechatCloudRouter;
